package cn.chaohi.controller.model.report;

import cn.chaohi.common.ApiException;
import cn.chaohi.common.CodeEnum;
import cn.chaohi.utils.RegexUtils;

public class ReportStatusReq {
	
	// 超市ID
	private String marketId;
	// 超市門店ID
	private String marketStoreId;
	// 车号
	private String cartNum;
	// 车子pad wifi的mac地址
	private String wifiMac;
	// 老版本
	private String version;
	//动作名称：1：下载  2：升级  3：降级 
	private String processType;
	//状态数值，0~100 （下载进度或者升级进度）
	private int processValue;
	
	private String errorCode;

	public void validate() throws Exception {
		if (RegexUtils.isEmpty(marketId)) {
			throw new ApiException(CodeEnum.REPORT_MARKET_ID);
		}
		if (RegexUtils.isEmpty(marketStoreId)) {
			throw new ApiException(CodeEnum.REPORT_MARKET_STORE_ID);
		}
		if (RegexUtils.isEmpty(wifiMac)) {
			throw new ApiException(CodeEnum.REPORT_WIFI_MAC);
		}
		if (RegexUtils.isEmpty(version)) {
			throw new ApiException(CodeEnum.REPORT_VERSION);
		}
		if (RegexUtils.isEmpty(processType)) {
			throw new ApiException(CodeEnum.REPORT_PROCESSTYPE);
		}
		if (RegexUtils.isEmpty(String.valueOf(processValue))) {
			throw new ApiException(CodeEnum.REPORT_PROCESSVALUE);
		}
	}

	public String getMarketId() {
		return marketId;
	}

	public void setMarketId(String marketId) {
		this.marketId = marketId;
	}

	public String getMarketStoreId() {
		return marketStoreId;
	}

	public void setMarketStoreId(String marketStoreId) {
		this.marketStoreId = marketStoreId;
	}

	public String getCartNum() {
		return cartNum;
	}

	public void setCartNum(String cartNum) {
		this.cartNum = cartNum;
	}

	public String getWifiMac() {
		return wifiMac;
	}

	public void setWifiMac(String wifiMac) {
		this.wifiMac = wifiMac;
	}

	public String getVersion() {
		return version;
	}

	public void setVersion(String version) {
		this.version = version;
	}

	public String getProcessType() {
		return processType;
	}

	public void setProcessType(String processType) {
		this.processType = processType;
	}

	public int getProcessValue() {
		return processValue;
	}

	public void setProcessValue(int processValue) {
		this.processValue = processValue;
	}

	public String getErrorCode() {
		return errorCode;
	}

	public void setErrorCode(String errorCode) {
		this.errorCode = errorCode;
	}

	public ReportStatusReq() {
		super();
	}
}
